import axios from "axios"

// eslint-disable-next-line import/no-anonymous-default-export
export default {
    //get请求
    get: ({ curPage, eachPage }) =>
        axios.get('/api/secondKill', {
            params: {
                curPage,
                eachPage
            }
        })
            .then(({ data }) => data),

    //get某一条数据       
    getOne: ({ _id }) =>
        axios.get('/api/secondKill/getOne',
          { params: { _id }})
            .then(({ data }) => data),

    //删除秒杀请求
    delete: ({ _id }) =>
        axios.delete('/api/secondKill/deleteSk',
            { params: { _id } })
            .then(({ data }) => data),


    //新增请求
    add: ({ Sale, Time, CommId, count }) =>
        axios.post('/api/secondKill/addSk', {
            Sale, Time, CommId, count
        })
            .then(({ data }) => data),

    //修改秒杀请求
    change: ({ Sale, Time, count, isAttend, _id,CommId }) =>
        axios.put('/api/secondKill/changeSk',
            { Sale, Time, count, isAttend, _id ,CommId})
            .then(({ data }) => data),




}